[TF frontend] add support for StridedSlice to input a single constant#6949
Conversation
| data_shape = get_const_tuple(in_type.checked_type.shape) | ||
| data_dim = len(data_shape) | ||
| stride_dim = len(stride) | ||
| if data_dim == 0 and isinstance(inputs[0], _expr.Constant): |
There was a problem hiding this comment.
I suspect this is data_dim==1, right? Otherwise, the data would just be empty. Also, could you add a test case to check this situation? In general, every new feature should come with an appropriate test (see the guidelines : https://tvm.apache.org/docs/contribute/pull_request.html)
There was a problem hiding this comment.
Maybe I didn't describe it clearly, the input here is a single number. So data_dim here is 0. This situation is the same as np.array(1). len(np.array(1).shape) == 0
There was a problem hiding this comment.
Cool, I didn't know that! I would still add a test to show when this situation arises (just to make sure that branch is covered). What do you think?
There was a problem hiding this comment.
👌add test for that.
|
@giuseros hi, tests have been added. |
|
eh, this branch has not been merged? Is there any problem? |
|
Hi @alter-xp , |
…apache#6949) * [TF frontend] add support for StridedSlice to input a single constant * add test for strideslice with a single number input * fix bug
…apache#6949) * [TF frontend] add support for StridedSlice to input a single constant * add test for strideslice with a single number input * fix bug
…apache#6949) * [TF frontend] add support for StridedSlice to input a single constant * add test for strideslice with a single number input * fix bug
@giuseros @siju-samuel